package com.lwm.controller;

import com.lwm.service.IAccountService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author liweimin
 * @date 2021/6/3 1:05
 * @since
 */

public class AccountController {
    public static void main(String[] args) {
        //1.获取核心容器对象
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");

        //2.根据id获取Bean对象
        IAccountService accountService = (IAccountService) ac.getBean("accountService");
        IAccountService accountService1 = (IAccountService) ac.getBean("accountService");

        System.out.println(accountService1 == accountService);

//        IAccountDAO accountDAO = (IAccountDAO) ac.getBean("accountDAO");

//        System.out.println(accountDAO);
//
//        System.out.println(accountService);

        accountService.saveAccount();

        ac.close();
    }
}
